package everydayGrade.t6;

import java.util.Arrays;

/**
 * @Author: Siantar
 * @Date: 2023-08-09-13:31
 * @Description: 1.0
 */
public class T1281 {
    public int subtractProductAndSum(int n) {
        int p = 1, q = 0;
        while (n != 0) {
            p *= n % 10;
            q += n % 10;
            n /= 10;
        }
        return p - q;
    }
}
